/**
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '../../../styles/variables';

.darkSkim {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  visibility: hidden;
  z-index: 998;

  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    background: $black;
    transition: 400ms ease;
  }

  &.open {
    visibility: visible;
    &::after {
      opacity: 0.7;
    }
  }
}

.bottomSheet {
  position: fixed;
  bottom: 0;
  left: 0;
  transform: translateY(100%);
  width: 100%;
  z-index: 999;

  &.active {
    .modal .dragHandle {
      pointer-events: initial;
    }
  }

  .modal {
    width: 100%;
    height: 75vh;
    padding-top: 32px;
    box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.1);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    background: white;
    border: 1px solid white;
    border-bottom: none;
    -webkit-overflow-scrolling: touch;
    overflow: scroll;
    touch-action: pan-y;

    .dragHandle {
      position: absolute;
      top: -30px;
      left: 16px;
      right: 16px;
      height: 80px;
      touch-action: none;
      cursor: pointer;
      transition: 400ms ease;
      will-change: transform;
      pointer-events: none;
      user-select: none;
      div {
        display: flex;
        justify-content: center;
        margin-top: 31px;
        width: 100%;
        position: relative;
        height: 24px;
        background: white;
        border-color: transparent;

        &::before {
          display: inline-block;
          content: '';
          width: 40px;
          margin-top: 8px;
          height: 6px;
          background: $medium_grey;
          border-radius: 16px;
        }
      }
    }
  }
}
